package roborally.model.evaluables;

import be.kuleuven.cs.som.annotate.*;
import roborally.model.*;

/**
 * A class that implements the interface Evaluable, representing a condition that can evaluate to true or false 
 * depending on the robot it is applied to. 
 * @note A RobotCondition must always be associated with a Robot, hence its evaluation is only applicable to- and depending on a robot.
 */
public abstract class RobotCondition implements Evaluable {

	/**
	 * The associated robot.
	 */
	private final Robot robot; 
	public final Robot getRobot(){ return this.robot; }
	
	/**
	 * @param 	robot
	 * 			The associated robot
	 * @throws IllegalArgumentException
	 * 			Thrown when the given robot is ineffective
	 */
	@Model
	protected RobotCondition(Robot robot) throws IllegalArgumentException
	{
		if(robot == null) throw new IllegalArgumentException("Argument 'robot' == null!");
		this.robot = robot;
	}
	
	@Override
	public abstract boolean evaluate();
	
}
